In the free and open environment of the Internet, data use, storage, and transmission all run the risk of leaks. Conventionally, data is protected by transparent file encryption and decryption methods. In particular, an example of a conventional technique of data protection includes the following: While a client device operating system is performing base-level processing, a data file undergoes encryption processing. When a user retrieves a data file, the operating system decrypts the data file and then places it in memory for the use of the user. When the user needs to save the data file, the operating system encrypts the data file and writes it into a magnetic disk, thereby making the user completely unaware of the encryption and decryption actions performed on the data file. Therefore, conventionally, data leaks are prevented by writing encrypted data into a magnetic disk and performing the encryption of data in memory. However, these conventional techniques do not ensure that the file in memory will not leak.